-
Notifications
You must be signed in to change notification settings - Fork 0
chore: testrunner setup #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| expect, | ||
| skip: (reason) => { | ||
| test.skip(reason); | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@niklashaug Does it make sense to pass skip here? Afaik skip needs to be called before the test is executed. But maybe that's a special feature of the node test runner (which I haven't used yet).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The node test runner supports skipping a test while being run: https://nodejs.org/api/test.html#skipping-tests
I just had a look, Jest for example doesn't seem to support it.
What I could do is, do the check whether the test should be skipped before returning inside of the map function, so that any test I want to skip is just not returned and therefore will not be run at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. It depends on whether you want to show to the user that there is a test but it is skipped (for whatever reason).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just thought about it again and noticed that this would mean that I'd have to execute parts of the test inside of the generateTestCases() function. But the main purpose of this function and the according method for the consumer should be to return the test cases which should be executed in a later step.
So I'll probably call skip if skip is defined and otherwise just let the test pass and additionally print out a warning or something similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍
# Conflicts: # src/api/index.ts # src/core/policy/policy-decision-point.ts # src/core/tests/runner/node-test-runner.ts # src/core/tests/runner/test-runner.ts # src/core/tests/test-executor.ts # src/core/tests/testcase-generator.ts # tests/mock-server.ts # tests/unit/test-executor.spec.ts
closes #22